package awt.robot;

import java.lang.Thread.State;

import util.ConcurrentUtils;

/**
 * A try to synchronise threads that starts some new threads. Thread startup is heavy native (asynchronous) operation.
 * 
 * @author Mykhaylo Adamovych
 */
public class CoreIdlePolicy implements IdlePolicy {
    @Override
    public boolean isIdle() {
        for (Thread thread : ConcurrentUtils.getActiveThreads())
            if (thread.getState().equals(State.NEW))
                return false;
        return true;
    }
}
